<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<ui:composition template="../templates/plantilla.xhtml">
	<ui:define name="content">
		<h:form prependId="false" id="growlForm">
			<p:growl id="growl" showDetail="false" />
		</h:form>
		<h:form prependId="false" id="dataForm" enctype="multipart/form-data">

			<p:panel id="data" toggleable="true" toggleSpeed="250">
				<f:facet name="header">
					<h:outputText value="#{avisoBean.name}" />
				</f:facet>
				<h:outputFormat id="noRecordsFound"
					value="#{messages.label_no_records_found}"
					rendered="#{!avisoBean.dataVisible}">
					<f:param value="Avisos" />
				</h:outputFormat>
				<p:dataTable id="list" value="#{avisoBean.allAvisos}"
					var="aviso" rendered="#{avisoBean.dataVisible}"
					resizableColumns="false" paginator="true"
					paginatorTemplate=" {CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="5,10,25,50" rows="10">
					<p:columns value="#{avisoBean.columns}" var="column"
						columnIndexVar="colIndex">
						<f:facet name="header">
							<h:outputText value="#{applicationBean.getColumnName(column)}" />
						</f:facet>
						<h:outputText value="#{aviso[column]}" />
					</p:columns>
					<p:column styleClass="action-column">
						<f:facet name="header">
							<h:outputText value="Actions" />
						</f:facet>
						<p:commandButton id="viewButton" icon="ui-icon-zoomin"
							update=":viewForm:viewPanelGrid" oncomplete="viewDialog.show()"
							title="#{messages.label_view}">
							<f:setPropertyActionListener value="#{aviso}"
								target="#{avisoBean.aviso}" />
						</p:commandButton>
						<p:tooltip for="viewButton" value="#{messages.label_view}"
							showEffect="fade" hideEffect="fade" />
						<p:commandButton id="editButton" icon="ui-icon-pencil"
							update=":editForm:editPanelGrid"
							action="#{avisoBean.onEdit}" oncomplete="editDialog.show()"
							title="#{messages.label_edit}">
							<f:setPropertyActionListener value="#{aviso}"
								target="#{avisoBean.aviso}" />
						</p:commandButton>
						<p:tooltip for="editButton" value="#{messages.label_edit}"
							showEffect="fade" hideEffect="fade" />
						<p:commandButton id="deleteButton" icon="ui-icon-trash"
							oncomplete="deleteDialog.show()" title="#{messages.label_delete}">
							<f:setPropertyActionListener value="#{aviso}"
								target="#{avisoBean.aviso}" />
						</p:commandButton>
						<p:tooltip for="deleteButton" value="#{messages.label_delete}"
							showEffect="fade" hideEffect="fade" />
					</p:column>
				</p:dataTable>
			</p:panel>

		</h:form>
	</ui:define>
</ui:composition>
</html>